package com.huawei.appmarket.service.store.awk.card;

import android.content.Context;
import android.view.View;
import com.huawei.appgallery.foundation.card.base.normal.bean.NormalCardBean;
import com.huawei.appgallery.foundation.ui.framework.cardkit.bean.CardBean;
import java.util.List;
import o.azb;
import o.cgz;
import o.ContentManager;
import o.epv;
import o.CollectCheck;
import o.ewm.d;

public class HorizontalFixedCard extends NormalHorizonCard {
    private int ʽ;

    public HorizontalFixedCard(Context context) {
        super(context);
    }

    private int ˋॱ() {
        return (((azb.ॱ(this.ʼॱ) - azb.ˊ(this.ʼॱ)) - azb.ˏ(this.ʼॱ)) - (this.ʼॱ.getResources().getDimensionPixelSize(d.ˋʽ) * ॱᐝ())) / (ॱᐝ() - 1);
    }

    private int ॱˋ() {
        return ˋॱ() - this.ʼॱ.getResources().getDimensionPixelSize(d.ॱ);
    }

    public cgz ˏ(View view) {
        super.ˏ(view);
        return this;
    }

    public void ˏ(CardBean cardBean) {
        super.ˏ(cardBean);
        List ॱ = this.ॱ.ॱ();
        if (!CollectCheck.isEmpty(ॱ) && ॱ.size() > ॱᐝ()) {
            this.ॱ.ˎ(ॱ.subList(0, ॱᐝ()));
        }
        this.ॱ.ॱ(false);
    }

    public void ˎ() {
        super.ˎ();
        this.ʽ = ʽॱ();
        this.ᐝ.ॱ(ॱˋ());
    }

    protected int ˏॱ() {
        return super.ˏॱ() - ॱˎ();
    }

    private int ॱˎ() {
        Context ˋ = ContentManager.getInstant().getContext();
        return (ˋ.getResources().getDimensionPixelSize(d.ˏͺ) - ˋ.getResources().getDimensionPixelSize(d.ˋʽ)) / 2;
    }

    protected boolean ˏ(Context context, List<NormalCardBean> list) {
        if (!CollectCheck.isEmpty(list) && list.size() >= ॱᐝ()) {
            return true;
        }
        return false;
    }

    private int ॱᐝ() {
        return this.ʽ;
    }

    private int ʽॱ() {
        if (epv.ʼ(this.ʼॱ)) {
            return 4;
        }
        return ˏ(this.ʼॱ, azb.ॱ(this.ʼॱ));
    }

    public static int ˏ(Context context, int i) {
        return (int) (((((((float) ((i - azb.ˊ(context)) - azb.ˏ(context))) * 1.0f) / ((float) context.getResources().getDimensionPixelSize(d.ˋʽ))) + 0.5f) / 1.5f) + 0.5f);
    }
}
